﻿using Framework.CapaDeDatos.Convertores;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using Framework.Modelo;

namespace FrameworkTest.CapaDeDatosTest
{
    [TestClass()]
    public class ConvertorJsonTest
    {
        private TestContext testContextInstance;

        public TestContext TestContext
        {
            get
            {
                return testContextInstance;
            }
            set
            {
                testContextInstance = value;
            }
        }

        [TestMethod()]
        public void ObtenerObjetoTestWithNull()
        {
            string jsonString = string.Empty; 
            IObjeto actual;
            actual = ConvertorJson.Obtener(jsonString);
            Assert.IsNull(actual);
        }

        [TestMethod()]
        public void ObtenerObjetoTestWithInstance()
        {
            IObjeto expected = new Objeto();
            string jsonString = ConvertorJson.Obtener(expected);
            IObjeto actual;
            actual = ConvertorJson.Obtener(jsonString);
            Assert.AreEqual(expected, actual);
        }

        [TestMethod()]
        public void ObtenerJsonStringTestWithNull()
        {
            IObjeto objeto = null; 
            string actual;
            actual = ConvertorJson.Obtener(objeto);
            Assert.IsNull(actual);
        }

        [TestMethod()]
        public void ObtenerJsonStringTestWithInstance()
        {
            IObjeto objeto = new Objeto();
            string actual;
            actual = ConvertorJson.Obtener(objeto);
            Assert.AreNotEqual(string.Empty, actual);
        }
    }
}
